/**
 * Copyright (C) 2010
 * Swarm Intelligence Team (SIT)
 * Department of Computer and Systems
 * University of Pernambuco
 * Brazil
 * 
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 */
package br.upe.ecomp.dosa.view.mainwindow;

import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.Color;
import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JSeparator;
import javax.swing.JTextArea;
import javax.swing.WindowConstants;

import org.jdesktop.layout.GroupLayout;
import org.jdesktop.layout.LayoutStyle;

/**
 * Update algorithm Dialog.
 * <p>
 * All the code was automatically generated using NetBeans.
 * 
 * @author rodrigo
 */
public abstract class UpdateAlgorithmDialog extends javax.swing.JDialog {

    private static final long serialVersionUID = 1L;

    /**
     * Creates new form UpdateAlgorithmDialog.
     * 
     * @param parent the Frame from which the dialog is displayed.
     * @param modal specifies whether dialog blocks user input to other top-level
     *            windows when shown. If <code>true</code>, the modality type property is set to
     *            <code>DEFAULT_MODALITY_TYPE</code>, otherwise the dialog is modeless.
     */
    public UpdateAlgorithmDialog(java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        initComponents();
    }

    /**
     * This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">
    private void initComponents() {

        defaultPanel = new JPanel();
        updatePanel = new JPanel();
        updateComboBox = new JComboBox();
        updateLabel = new JLabel();
        updateTitleSeparator = new JSeparator();
        updateDescriptionScrollPane = new JScrollPane();
        updateDescriptionTextArea = new JTextArea();
        jLabel7 = new JLabel();
        jSeparator6 = new JSeparator();
        flowButtonsPanel = new JPanel();
        finishButton = new JButton();
        cancelButton = new JButton();

        setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);

        defaultPanel.setLayout(new CardLayout());

        updateLabel.setText("Algorithm");

        updateDescriptionScrollPane.setBackground(new Color(153, 153, 153));
        updateDescriptionScrollPane.setBorder(null);

        updateDescriptionTextArea.setBackground(new Color(238, 238, 238));
        updateDescriptionTextArea.setColumns(20);
        updateDescriptionTextArea.setEditable(false);
        updateDescriptionTextArea.setRows(5);
        updateDescriptionTextArea.setText("Algorithm description goes here...");
        updateDescriptionTextArea.setWrapStyleWord(true);
        updateDescriptionTextArea.setCaretColor(new Color(238, 238, 238));
        updateDescriptionTextArea.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
        updateDescriptionScrollPane.setViewportView(updateDescriptionTextArea);

        jLabel7.setText("Description");

        GroupLayout updatePanelLayout = new GroupLayout(updatePanel);
        updatePanel.setLayout(updatePanelLayout);
        updatePanelLayout.setHorizontalGroup(updatePanelLayout.createParallelGroup(GroupLayout.LEADING).add(
                updatePanelLayout
                        .createSequentialGroup()
                        .addContainerGap()
                        .add(updatePanelLayout.createParallelGroup(GroupLayout.LEADING).add(jLabel7)
                                .add(updateDescriptionScrollPane, GroupLayout.DEFAULT_SIZE, 659, Short.MAX_VALUE)
                                .add(jSeparator6, GroupLayout.DEFAULT_SIZE, 659, Short.MAX_VALUE)
                                .add(updateComboBox, 0, 659, Short.MAX_VALUE)
                                .add(updateTitleSeparator, GroupLayout.DEFAULT_SIZE, 659, Short.MAX_VALUE)
                                .add(updateLabel)).addContainerGap()));
        updatePanelLayout.setVerticalGroup(updatePanelLayout.createParallelGroup(GroupLayout.LEADING).add(
                updatePanelLayout
                        .createSequentialGroup()
                        .addContainerGap()
                        .add(updateLabel)
                        .add(0, 0, 0)
                        .add(updateTitleSeparator, GroupLayout.PREFERRED_SIZE, 10, GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(LayoutStyle.UNRELATED)
                        .add(updateComboBox, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                                GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(LayoutStyle.RELATED, 184, Short.MAX_VALUE)
                        .add(jLabel7)
                        .add(0, 0, 0)
                        .add(jSeparator6, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                                GroupLayout.PREFERRED_SIZE)
                        .add(0, 0, 0)
                        .add(updateDescriptionScrollPane, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                                GroupLayout.PREFERRED_SIZE).addContainerGap()));

        defaultPanel.add(updatePanel, "card2");

        getContentPane().add(defaultPanel, BorderLayout.CENTER);

        flowButtonsPanel.setMinimumSize(new Dimension(100, 40));
        flowButtonsPanel.setPreferredSize(new Dimension(508, 40));
        flowButtonsPanel.setLayout(new FlowLayout(FlowLayout.RIGHT));

        finishButton.setText("Finish");
        finishButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
                finishButtonActionPerformed(evt);
            }
        });
        flowButtonsPanel.add(finishButton);

        cancelButton.setText("Cancel");
        cancelButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
                cancelButtonActionPerformed(evt);
            }
        });
        flowButtonsPanel.add(cancelButton);

        getContentPane().add(flowButtonsPanel, BorderLayout.PAGE_END);

        pack();
    }// </editor-fold>

    protected abstract void finishButtonActionPerformed(ActionEvent evt);

    protected abstract void cancelButtonActionPerformed(ActionEvent evt);

    // Variables declaration - do not modify
    protected JButton cancelButton;
    protected JPanel defaultPanel;
    protected JButton finishButton;
    protected JPanel flowButtonsPanel;
    protected JLabel jLabel7;
    protected JSeparator jSeparator6;
    protected JComboBox updateComboBox;
    protected JScrollPane updateDescriptionScrollPane;
    protected JTextArea updateDescriptionTextArea;
    protected JLabel updateLabel;
    protected JPanel updatePanel;
    protected JSeparator updateTitleSeparator;
    // End of variables declaration

}
